<?php echo $header; ?>
<?php if ($error_warning) { ?>
<div class="warning"><?php echo $error_warning; ?></div>
<?php } ?>
<?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content">
  <div class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
    <?php } ?>
  </div>
  <h1><?php echo $heading_title; ?></h1>
  <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
    <h2><?php echo $text_your_details; ?></h2>
    <div class="content">
      <table class="form">      
        <tr>
          <td><span class="required">*</span> <?php echo $entry_firstname; ?></td>
          <td><input type="text" name="firstname" value="<?php echo $firstname; ?>" />
            <?php if ($error_firstname) { ?>
            <span class="error"><?php echo $error_firstname; ?></span>
            <?php } ?></td>
        </tr>
        <tr>
        	<td><?php echo $entry_middlename; ?></td>
        	<td>
        		<input type="text" name="middlename" value="<?php echo $middlename ?>" />
        		<?php if ($error_middlename) { ?>
        			<span class="error"><?php echo $error_middlename; ?></span>
        		<?php } ?>
        	</td>
        </tr>
        <tr>
          <td><span class="required">*</span> <?php echo $entry_lastname; ?></td>
          <td><input type="text" name="lastname" value="<?php echo $lastname; ?>" />
            <?php if ($error_lastname) { ?>
            <span class="error"><?php echo $error_lastname; ?></span>
            <?php } ?></td>
        </tr>
        <tr>
          <td><?php echo $entry_email; ?></td>
          <td><?php echo $email; ?>
        </tr>
        <tr>
          <td><span class="required">*</span> <?php echo $entry_gender; ?></td>
          <td>
          	<?php if ($gender === 'male') { ?>
          		<input type="radio" name="gender" value="male" checked="checked" /><?php echo $text_male; ?>
          		<input type="radio" name="gender" value="female" /><?php echo $text_female; ?>
          	<?php } else { ?>
          		<input type="radio" name="gender" value="male" /><?php echo $text_male; ?>
          		<input type="radio" name="gender" value="female" checked="checked" /><?php echo $text_female; ?>
          	<?php } ?>
          	
            <?php if ($error_gender) { ?>
            <span class="error"><?php echo $error_gender; ?></span>
            <?php } ?></td>
        </tr>        
        <tr>
        	<td><span class="required">*</span><?php echo $entry_title; ?></td>
        	<td>
	        	<input type="text" name="title" value="<?php echo $title; ?>" />
	            <?php if ($error_title) { ?>
	            <span class="error"><?php echo $error_title; ?></span>
	            <?php } ?>
            </td>
        </tr>
        <tr>
        	<td><span class="required">*</span><?php echo $entry_name; ?></td>
        	<td>
	        	<input type="text" name="name" value="<?php echo $name; ?>" />
	            <?php if ($error_name) { ?>
	            <span class="error"><?php echo $error_name; ?></span>
	            <?php } ?>
            </td>
        </tr>
        <tr>
          <td><?php echo $entry_company; ?></td>
          <td>
          	<input type="text" name="company" value="<?php echo $company; ?>" />
          </td>
         </tr>    
        <tr>
          <td><span class="required">*</span> <?php echo $entry_telephone; ?></td>
          <td><input type="text" name="telephone" value="<?php echo $telephone; ?>" />
            <?php if ($error_telephone) { ?>
            <span class="error"><?php echo $error_telephone; ?></span>
            <?php } ?></td>
        </tr>
        <tr>
          <td><?php echo $entry_fax; ?></td>
          <td><input type="text" name="fax" value="<?php echo $fax; ?>" /></td>
        </tr>
        <tr>
        	<td><?php echo$entry_website; ?></td>
        	<td>
        		<input type="text" name="website" value="<?php echo $website; ?>" />
        		<?php if($error_website) { ?>
        			<span class="error"><?php echo $error_website; ?></span>
        		<?php } ?>
        	
        	</td>
        </tr>
      </table>
    </div>
    <h2><?php echo $text_your_address; ?></h2>
    <div class="content">
      <table class="form">
      <tr>
          <td><span class="required">*</span> <?php echo $entry_country; ?></td>
          <td><select name="country_id">
              <option value=""><?php echo $text_select; ?></option>
              <?php foreach ($countries as $country) { ?>
              <?php if ($country['country_id'] == $country_id) { ?>
              <option value="<?php echo $country['country_id']; ?>" selected="selected"><?php echo $country['name']; ?></option>
              <?php } else { ?>
              <option value="<?php echo $country['country_id']; ?>"><?php echo $country['name']; ?></option>
              <?php } ?>
              <?php } ?>
            </select>
            <?php if ($error_country) { ?>
            <span class="error"><?php echo $error_country; ?></span>
            <?php } ?></td>
        </tr>    
        <tr>
          <td><span class="required">*</span> <?php echo $entry_address_1; ?></td>
          <td><input type="text" name="address_1" value="<?php echo $address_1; ?>" />
            <?php if ($error_address_1) { ?>
            <span class="error"><?php echo $error_address_1; ?></span>
            <?php } ?></td>
        </tr>
        <tr>
          <td><?php echo $entry_address_2; ?></td>
          <td><input type="text" name="address_2" value="<?php echo $address_2; ?>" /></td>
        </tr>
        <tr>
          <td><span class="required">*</span> <?php echo $entry_city; ?></td>
          <td><input type="text" name="city" value="<?php echo $city; ?>" />
            <?php if ($error_city) { ?>
            <span class="error"><?php echo $error_city; ?></span>
            <?php } ?></td>
        </tr>
        <tr>
          <td><span class="required">*</span> <?php echo $entry_zone; ?></td>
          <td><input type="text" name="zone" value="<?php echo $zone; ?>" />
            <?php if ($error_zone) { ?>
            <span class="error"><?php echo $error_zone; ?></span>
            <?php } ?>
          </td>
        </tr>
        <tr>
          <td><span id="postcode-required" class="required">*</span> <?php echo $entry_postcode; ?></td>
          <td><input type="text" name="postcode" value="<?php echo $postcode; ?>" />
            <?php if ($error_postcode) { ?>
            <span class="error"><?php echo $error_postcode; ?></span>
            <?php } ?></td>
        </tr>
      </table>
    </div>
    <div class="buttons">
      <div class="left"><a href="<?php echo $back; ?>" ><?php echo $button_back; ?></a></div>
      <div class="right">
        <input type="submit" value="<?php echo $button_save; ?>" />
      </div>
    </div>
  </form>
</div>

<?php echo $footer; ?>
